#include <iostream>
#include <string>
using namespace std;
string s1, s2;

string convert(string a)
{
    string s;
    for (int i = 1; i < a.size(); i++)
    {
        if (a[i] % 2 == a[i - 1] % 2)
        {
            s += max(a[i], a[i - 1]);
        }
    }
    return s;
}
int main()
{
    cin >> s1 >> s2;
    if ((s1 = convert(s1)) == (s2 = convert(s2))) 
    {
        cout << s1 << endl;
        return 0;
    }
    else{
        cout << s1 << endl;
        cout << s2 << endl;
    }
    return 0;
}